Guard against exceptions caused by destroying player in buffer stall error callbacks #4786
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will...
Guard against exceptions caused by destroying player in buffer stall error callbacks.
Why is this Pull Request needed?
The
media
property of GapController is cleared when the player is destroyed. Some applications choose to do this on BUFFER_STALLED_ERROR events. Improved type handling and some early returns correct this behavior.Other changes?
Prior to triggering BUFFER_STALLED_ERROR, log the full
BufferInfo
object rather than just the buffer length from currentTime. This will help identify stalls in Chrome that occur ~1s after playing through buffer gaps (a new buffered range "start"). This is for issues like #4470.Resolves issues:
Fixes #4525
Related to #4478
Checklist